package com.cloudlead.plugin.security.query;

import static com.mysema.query.types.PathMetadataFactory.*;
import com.cloudlead.plugin.security.entity.EScUserHasPrivilege;


import com.mysema.query.types.path.*;

import com.mysema.query.types.PathMetadata;
import javax.annotation.Generated;
import com.mysema.query.types.Path;

import com.mysema.query.sql.ColumnMetadata;
import java.sql.Types;

import com.mysema.query.sql.*;

import com.cloudlead.common.lang.annotation.Label;


/**
 * QScUserHasPrivilege is a Querydsl query type for EScUserHasPrivilege
 */
@Label("用户对应的权限查询")
@Generated("com.cloudlead.utils.persistence.codegen.serializer.SimpleMetaDataSerializer")
public class QScUserHasPrivilege extends RelationalPathBase<EScUserHasPrivilege> {

    private static final long serialVersionUID = 480169257;

    public static final QScUserHasPrivilege scUserHasPrivilege = new QScUserHasPrivilege("sc_user_has_privilege");

    public class PrimaryKeys {

        public final PrimaryKey<EScUserHasPrivilege> primary = createPrimaryKey(id);

    }

    public class ForeignKeys {

        public final ForeignKey<com.cloudlead.plugin.security.entity.EScPrivilege> scUserHasPrivilegeScPermission1Fk = createForeignKey(scPrivilegeId, "id");

        public final ForeignKey<com.cloudlead.plugin.security.entity.EScUser> scUserHasPrivilegeScUser1Fk = createForeignKey(scUserId, "id");

    }

    public final StringPath id = createString("id");

    public final BooleanPath isPermission = createBoolean("isPermission");

    public final StringPath scPrivilegeId = createString("scPrivilegeId");

    public final StringPath scUserId = createString("scUserId");

    public final PrimaryKeys pk = new PrimaryKeys();

    public final ForeignKeys fk = new ForeignKeys();

    public QScUserHasPrivilege(String variable) {
        super(EScUserHasPrivilege.class, forVariable(variable), "null", "sc_user_has_privilege");
        addMetadata();
    }

    public QScUserHasPrivilege(String variable, String schema, String table) {
        super(EScUserHasPrivilege.class, forVariable(variable), schema, table);
        addMetadata();
    }

    public QScUserHasPrivilege(Path<? extends EScUserHasPrivilege> path) {
        super(path.getType(), path.getMetadata(), "null", "sc_user_has_privilege");
        addMetadata();
    }

    public QScUserHasPrivilege(PathMetadata<?> metadata) {
        super(EScUserHasPrivilege.class, metadata, "null", "sc_user_has_privilege");
        addMetadata();
    }

    public void addMetadata() {
        addMetadata(id, ColumnMetadata.named("id").withIndex(1).ofType(Types.CHAR).withSize(24).notNull());
        addMetadata(isPermission, ColumnMetadata.named("is_permission").withIndex(4).ofType(Types.BIT));
        addMetadata(scPrivilegeId, ColumnMetadata.named("sc_privilege_id").withIndex(3).ofType(Types.CHAR).withSize(24).notNull());
        addMetadata(scUserId, ColumnMetadata.named("sc_user_id").withIndex(2).ofType(Types.CHAR).withSize(24).notNull());
    }

}

